import { createApp } from 'vue'
import Vant from 'vant';
import 'vant/lib/index.css';
// import ElementPlus from 'element-plus';
// import 'element-plus/lib/theme-chalk/index.css';
// import 'xe-utils'
// import VXETable from 'vxe-table'
// import 'vxe-table/lib/style.css'
import * as api from "./utils/api";
import storage from "@/utils/storage";
import { router } from "./router"
import { Toast } from "vant";
import { createStore } from 'vuex'
import App from './App.vue'

// 若是没有开启Devtools工具，在开发环境中开启，在生产环境中关闭
// if (process.env.NODE_ENV == 'development') {
//     Vue.config.devtools = true;
// } else {
//     Vue.config.devtools = false;
// }

const store = createStore({
    state() {
        return {
            theme: "light"
        }
    },
    mutations: {
        changeTheme(state, theme) {
            state.theme = theme;
        }
    }
})
const app = createApp(App);
app.use(Vant).use(router).use(store);
// app.use(ElementPlus);\
// .use(VXETable);
app.mount('#app');

//全局挂载
app.config.globalProperties.$api = api;
app.config.globalProperties.$storage = storage;
app.config.globalProperties.$Toast = Toast;